package com.jzd.fwserver

import com.jzd.fwserver.util.toByteArrayByASCII
import com.jzd.fwserver.util.toHexString
import org.junit.Test

class Test
{
    @Test
    fun main()
    {
        val url = "rtmp://192.168.49.138:1935/live/123"
        val urlLength = url.length
        val urlArray = url.toByteArrayByASCII()
        val byteArray = byteArrayOf((urlLength and 0xFF).toByte(),
                (urlLength shr 8 and 0xFF).toByte()).plus(urlArray)
        println(byteArray.toHexString())
    }
}